#include "Line.hpp"
#include <allegro.h>
#include <cmath>

void Line::draw(BITMAP* screen, int color) {
    circle(screen, x, y, 2, makecol(255, 0, 0));

    int x1 = x - tan(angle) * y;
    int x2 = x + tan(angle) * (SCREEN_H - y);
    line(screen, x1, 0, x2, SCREEN_H, color);
}
